<template>
  <div class="news-info">
    <van-panel :title="newsinfo.zhaiyao"  :status="'阅读'+newsinfo.click+'次'">
      <div>{{newsinfo.content}}</div>
    </van-panel>
    <comments :id="id"></comments>
  </div>
</template>

<script>
import comments from "../../components/comments"
export default {
  components:{
    comments
  },
  props:['id'],
  data () {
    return {
      newsinfo:{}
    }
  },
  created () {
    this.getNewsInfo()
  },
  methods:{
    async getNewsInfo () {
      const res = await this.$http.getNewsInfo(this.id)
      this.newsinfo = res.data.message
      // console.log(this.newsinfo)
    }
  }
}
</script>
<style lang="scss" scoped>
.news-info{
  padding: 10px;
  .van-cell__title{
    font-size: 18px;
    font-weight: 600;
  }
  .van-panel__content{
    font-size: 12px;
    padding: 10px;
    text-indent: 2em;
  }
}
</style>
